import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *


class Combox(QWidget):
    def __init__(self, parents=None):
        super(Combox, self).__init__(parents)
        self.setWindowTitle('Combox')
        self.resize(300, 90)
        layout = QVBoxLayout()
        self.lbl = QLabel('')

        self.cb = QComboBox()
        self.cb.addItem('C')
        self.cb.addItem('C++')
        self.cb.addItems(['Java', 'C#', 'Python'])
        self.cb.currentIndexChanged.connect(self.schange)
        layout.addWidget(self.cb)
        layout.addWidget(self.lbl)
        self.setLayout(layout)

    def schange(self, i):
        self.lbl.setText(self.cb.currentText())
        print('Items are:')
        for count in range(self.cb.count()):
            print('item' + str(count) + '=' + self.cb.itemText(count))
            print('Current index', i, 'changed', self.cb.currentText())


if __name__ == '__main__':
    app = QApplication(sys.argv)
    combox = Combox()
    combox.show()
    sys.exit(app.exec_())
